package com.longcai.mapper.scm;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Select;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.longcai.entity.homegood.ClyjGoodsSpec;
import com.longcai.entity.homepage.GoodsClass;
import com.longcai.entity.scm.ClyjScmGoods;
import com.longcai.entity.scm.ClyjScmGoodsSpec;

/**
 * <p>
 * 首页商品表 Mapper 接口
 * </p>
 *
 * @author LWK
 * @since 2019-04-23
 */
public interface ClyjScmGoodsMapper extends BaseMapper<ClyjScmGoods> {
	@Select("select c.* from goods_class c , clyj_scm_goods_type cb where c.id = cb.type_id and cb.goods_id = #{goodsId} order by c.type_sort")
	List<GoodsClass> listByBrandId(String goodsId);

	void deleteType(String goodsId);

	void insertType(Map map);

	void insertSpec(Map map);

	void deleteSpec(String goodsId);

	@Select("select * from clyj_scm_goods_spec where goods_id = #{goodsId} order by spec_sort")
	List<ClyjScmGoodsSpec> getSpecByGoodsId(String goodsId);

	void deletePics(String goodsId);
}
